/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package stuff;

import functions.HealingSet;
import java.util.Comparator;

/**
 *
 * @author JArik
 */
public class HealingSetComparator implements Comparator<HealingSet>{

    @Override
    public int compare(HealingSet set1, HealingSet set2) {
        if( (!set1.getResult().isEmpty() && !set2.getResult().isEmpty()) || (set1.getResult().isEmpty() && set2.getResult().isEmpty()) )
        {
          if(set1.getLastVisit().after(set2.getLastVisit()))
            return 0;
          else
            return 1;
        } else
        {
            if(set1.getResult().isEmpty())
                return 0;
            if(set2.getResult().isEmpty())
                return 1;
        }
        return 0;
    }


}
